package com.aiprompt;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

/**
 * 密码生成工具
 */
public class PasswordGenerator {
    public static void main(String[] args) {
        BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
        
        // 生成admin123的BCrypt哈希
        String adminPassword = encoder.encode("admin123");
        System.out.println("admin123 -> " + adminPassword);
        
        // 生成user123456的BCrypt哈希
        String userPassword = encoder.encode("user123456");
        System.out.println("user123456 -> " + userPassword);
        
        // 验证密码
        System.out.println("验证admin123: " + encoder.matches("admin123", adminPassword));
        System.out.println("验证user123456: " + encoder.matches("user123456", userPassword));
    }
}
